package com.gusti.turnos.quartz;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.gusti.turnos.services.IFilterService;

@Configurable(preConstruction=true)
public class RunMeJob extends QuartzJobBean {

	@Autowired
	IFilterService filterService;

	private int timeout;

	public int getTimeout() {
		return timeout;
	}
	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}
	public IFilterService getFilterService() {
		return filterService;
	}
	public void setFilterService(IFilterService filterService) {
		this.filterService = filterService;
	}

	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {	
		filterService.doWork( timeout );
	}
}
